/*
 * @Author: ZhanXie
 * @Date: 2020-03-17 14:15:40
 * @LastEditors: ZhanXie
 * @LastEditTime: 2020-05-09 14:20:33
 * @Description: 
 * @FilePath: /projectStudy/mini-redux/src/index.js
 */
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware } from './mini-redux';
import { Provider } from './mini-react-redux'
import thunk from './mini-redux-thunk'
import thunkArray from './mini-redux-array'
import App from './App';
import { reducer } from './counter.redux';

class Rectangle {
  constructor(height, width) {
      this.height = height;
      this.width = width;
  }

  _name = '1'

  // set name(name) {
  //   console.log(name)
  //   return this.name = name
  // }

  // set name

  get name() {
    return this._name
  }
  // Getter
  get area() {
      return this.calcArea()
  }
  // Method
  calcArea() {
      console.log(this.height, this.width)
      return this.height * this.width;
  }
} 

const square = new Rectangle(10, 10);
console.log(square, square.area, ); // 100

const store = createStore(reducer,applyMiddleware(thunk,thunkArray))

ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root')
);